package com.example.recruitment.controller;

import com.example.recruitment.service.JobService;
import com.example.recruitment.service.ResumeService;
import com.example.recruitment.service.InterviewService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class IndexController {

    @Autowired
    private JobService jobService;

    @Autowired
    private ResumeService resumeService;

    @Autowired
    private InterviewService interviewService;

    @GetMapping("/")
    public String index(Model model) {
        // 获取统计数据
        model.addAttribute("openJobs", jobService.countByStatus("OPEN"));
        model.addAttribute("pendingResumes", resumeService.countByStatus("PENDING"));
        model.addAttribute("todayInterviews", interviewService.countTodayInterviews());
        model.addAttribute("monthlyHires", interviewService.countMonthlyHires());
        
        return "index";
    }
} 